package com.shane.music.scrubber
{
	///
	///  assumes the use of scrubbyVolume on the same level 
	///	assumes scrubbyVolumes name is thumb 
	///
	import flash.display.MovieClip;
	import flash.display.SimpleButton;
	import flash.events.Event;
	import flash.events.MouseEvent;
	
	public class volumeMinusBtn extends SimpleButton
	{
		private var mom:MovieClip;
		private var i:int;
		public function volumeMinusBtn() {
			mom = this.parent as MovieClip;
			this.addEventListener(MouseEvent.MOUSE_DOWN, mouseDown, false, 0, true);	
		}
		private function mouseDown(e:MouseEvent) {
			i = 0;
			this.addEventListener(MouseEvent.MOUSE_UP, mouseUp, false, 0, true);
			this.addEventListener(Event.EXIT_FRAME, everyFrame, false,0, true);
		}
		private function mouseUp(e:MouseEvent) {
			this.removeEventListener(MouseEvent.MOUSE_UP, mouseUp, false);
			this.removeEventListener(Event.EXIT_FRAME, everyFrame);
		}
		private function everyFrame (e:Event) :void{
			
			//smooth ramp up of vx
			if (i < 80)
				i++;
			mom.thumb.volDown(i*.4);
		}

	}
}